package com.furentech.iotserver.fa.utils;

import java.io.ByteArrayInputStream;

public class NumberUtil {
    public static long byte2intBE(byte[] bytes,int offset,int length) {
        int mask = 0xff;
        int temp = 0;
        long res = 0;
        int byteslen = length;
        if (byteslen > 8) {
            return Long.valueOf(0L);
        }
        for (int i = 0; i < byteslen; i++) {
            res <<= 8;
            temp = bytes[i + offset] & mask;
            res |= temp;
        }
        return res;
    }
}
